Skip to content

Migrate from .NET Core 1.1 to .NET 10#1

Closed
karluiz wants to merge 5 commits into
masterfrom
migrate/net10
Closed

Migrate from .NET Core 1.1 to .NET 10#1
karluiz wants to merge 5 commits into
masterfrom
migrate/net10

Conversation

@karluiz

@karluiz karluiz commented Jun 11, 2026

Copy link
Copy Markdown
Owner

Summary

  • Retarget GR.Repository, GR.Services, and GR.Mvc from netcoreapp1.1 to net10.0; pin SDK 10.0.101 via global.json
  • Upgrade MongoDB.Driver 2.4.3 → 3.9.0 (only break: ReplaceOneAsync overload ambiguity, fixed with an explicit ReplaceOptions cast)
  • Replace Program/Startup pair with minimal hosting; drop Microsoft.AspNetCore.* package refs (SDK framework reference), BrowserLink, Application Insights, and the dead CodeGeneration CLI tool ref
  • Remove bower/bundleconfig tooling (committed wwwroot assets unchanged), modernize environment tag helpers, appsettings logging schema, and launchSettings

Test Plan

  • dotnet build GR.Mvc.sln — 0 warnings, 0 errors
  • App starts; /Home/About returns 200
  • Ticket index (MongoDB-backed GetAll) returns 200 against local MongoDB
  • Manual CRUD pass (add/edit/delete ticket) in a browser

🤖 Generated with Claude Code

karluiz and others added 5 commits June 11, 2026 09:10
@karluiz

karluiz commented Jun 11, 2026

Copy link
Copy Markdown
Owner Author

Runtime verification notes (full CRUD pass done against local MongoDB, all green):

  • ✅ Add / edit / delete a ticket all work end-to-end; the edit path exercises the one driver-3.9 code change (ReplaceOneAsync with the ReplaceOptions cast).
  • 🔍 Edge probes surfaced two weaknesses that are pre-existing 1.1 behavior, not regressions (identical code on master):
    • GET /Ticket/Edit?id=<malformed> → 500 (unguarded ObjectId.Parse throws FormatException).
    • POST /Ticket/AddOrUpdate with an empty body inserts a blank ticket (no validation attributes on Ticket).
  • These match the latent issues listed as optional Task 6 in docs/superpowers/plans/2026-06-11-migrate-to-net10.md — candidates for a follow-up PR.

🤖 Generated with Claude Code

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Migrates the solution from .NET Core 1.1 to .NET 10, updates MongoDB.Driver to 3.x, and modernizes the ASP.NET Core MVC host and legacy tooling/config to match current .NET conventions.

Changes:

  • Retarget GR.Repository / GR.Services / GR.Mvc to net10.0, pin SDK via global.json, and update MongoDB.Driver to 3.9.0 with an overload-disambiguation adjustment.
  • Replace the Program/Startup hosting model with minimal hosting and remove legacy ASP.NET Core package/tooling references (Application Insights snippet, BrowserLink, CodeGeneration CLI tool).
  • Remove bower/bundler config files and update Razor environment tag helper usage plus logging / launch settings.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
GR.Services/GR.Services.csproj Retargets services project to net10.0 and disables nullable/implicit usings.
GR.Repository/GR.Repository.csproj Retargets repository project to net10.0 and upgrades MongoDB.Driver to 3.9.0.
GR.Repository/Repository.cs Adjusts MongoDB ReplaceOneAsync call for new overload behavior.
GR.Mvc/GR.Mvc.csproj Retargets MVC app to net10.0 and removes legacy package/tool refs now covered by the shared framework.
GR.Mvc/Program.cs Replaces Startup-based hosting with minimal hosting pipeline and DI registration.
GR.Mvc/Startup.cs Deleted as part of minimal hosting migration.
GR.Mvc/appsettings.json Updates logging schema and changes base MongoDB connection string value.
GR.Mvc/appsettings.Development.json Updates logging schema (drops legacy IncludeScopes).
GR.Mvc/Properties/launchSettings.json Simplifies launch profiles and standardizes local URL.
GR.Mvc/Views/Shared/_Layout.cshtml Removes Application Insights snippet and updates environment tag helper attributes.
GR.Mvc/Views/Shared/_ValidationScriptsPartial.cshtml Updates environment tag helper attributes to modern syntax.
GR.Mvc/.bowerrc Deleted (removes bower-era config).
GR.Mvc/bower.json Deleted (removes bower-era dependency manifest).
GR.Mvc/bundleconfig.json Deleted (removes BundlerMinifier configuration).
global.json Pins repository SDK selection to .NET SDK 10.0.101.
docs/superpowers/plans/2026-06-11-migrate-to-net10.md Adds migration implementation plan documentation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


var idFilter = Builders<T>.Filter.Eq(e => e.Id, entity.Id); //Find entity with same Id
var result = await Collection.ReplaceOneAsync(idFilter, entity, null, cancellationToken);
var result = await Collection.ReplaceOneAsync(idFilter, entity, (ReplaceOptions)null, cancellationToken);
Comment thread GR.Mvc/Program.cs
Comment on lines +15 to 18
if (!app.Environment.IsDevelopment())
{
app.UseExceptionHandler("/Home/Error");
}
Comment thread GR.Mvc/appsettings.json

"ConnectionStrings": {
"MongoConnectionString": "{your mongodb connection string here}"
"MongoConnectionString": "mongodb://localhost:27017/GR"
Comment on lines +1 to 5
{
"Logging": {
"IncludeScopes": false,
"LogLevel": {
"Default": "Debug",
"System": "Information",
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants